﻿<UserControl x:Class="ucItems2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my= "clr-namespace:ATS" Width="auto">
    <UserControl.Resources>
    <Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="Opacity" Value=".80" />
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1" ScaleY="1"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                Padding="{TemplateBinding Padding}">
                        <ContentPresenter x:Name="ContentSite" 
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Offset="0" Color="LightGray"/>
                                            <GradientStop Offset="1" Color="DarkGray"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="Silver" />
                            <Setter Property="Opacity" Value="1"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="Selector.IsSelectionActive" 
                                               Value="false" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" Value="LightGray" />
                            <Setter Property="BorderBrush" Value="DarkGray" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="Gray" />
            </Trigger>
            <EventTrigger RoutedEvent="Mouse.MouseEnter">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard>
                            <!--DoubleAnimation Duration="0:0:0.0"                                                 
                                                 Storyboard.TargetProperty="(ListBoxItem.LayoutTransform).(ScaleTransform.ScaleY)"
                                                 From="1" To="1.125"/>
                                    <DoubleAnimation Duration="0:0:0.0"                                                 
                                                 Storyboard.TargetProperty="(ListBoxItem.LayoutTransform).(ScaleTransform.ScaleX)"
                                                 From="1" To="1.125"/-->
                            <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetProperty="Opacity"
                                                 To="1.0" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Mouse.MouseLeave">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard>
                            <!--DoubleAnimation Duration="0:0:0.0"
                                                 Storyboard.TargetProperty="(ListBoxItem.LayoutTransform).(ScaleTransform.ScaleY)"
                                                 From="1.125" To="1"/>
                                    <DoubleAnimation Duration="0:0:0.0"                                                 
                                                 Storyboard.TargetProperty="(ListBoxItem.LayoutTransform).(ScaleTransform.ScaleX)"
                                                 From="1.125" To="1"/-->
                            <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetProperty="Opacity" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
        </Style.Triggers>
    </Style>


    <DataTemplate x:Key="listBoxTemplate">
        <Border BorderBrush="Blue"
                    BorderThickness="1"
                    CornerRadius="1"
                    Margin="1">
            <StackPanel Orientation="Vertical">
                <TextBlock Text="{Binding AssetNumber}" 
                               Foreground="Green" 
                               FontWeight="Bold"
                                   Name="username" Margin="1"/>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0">
                    <Label Content="{Binding CategoryDisplay}" 
                               Foreground="Green" Name="categoryCode" HorizontalAlignment="Left"  VerticalAlignment="Center"/>
                </StackPanel>
            </StackPanel>
        </Border>
    </DataTemplate>
        
        <DataTemplate x:Key="listBoxImageTemplate">
            <Border BorderBrush="Blue"
                    BorderThickness="1"
                    CornerRadius="1"
                    Margin="1">
                <StackPanel Orientation="Vertical">
                    <Image Source="/images/controls/button_cancelx.png"                           
                           Width="10"
                           Height="10"
                           Margin="2"
                           HorizontalAlignment="Right"
                           Name="buttonDeleteCustomerVehicle"
                           MouseLeftButtonDown="buttonDeleteItemClickHandler"
                           ></Image>
                    <Image Source="{Binding ImageLocation}"
                           MinWidth="5"
                           Width="100"
                           Height="100"
                           Margin="2"
                           ></Image>
                    <TextBlock Text="{Binding ImageName}" 
                               Foreground="Green" 
                               FontWeight="Bold"
                                   Margin="2"
                               HorizontalAlignment="Center" />                    
                </StackPanel>
            </Border>
        </DataTemplate>
        
        

    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander Width="Auto" ExpandDirection="Right" HorizontalAlignment="Right" Grid.Column="0">
            <Expander.Header>
                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Margin="0,0,0,0" Width="Auto" Name="ExpanderText">
            <TextBlock.LayoutTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="90"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </TextBlock.LayoutTransform>
            <TextBlock.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </TextBlock.RenderTransform>
                </TextBlock>
            </Expander.Header>

            <Border Name="borderHeader" BorderBrush="Gray" 
                BorderThickness="1,1,1,1" 
                                    CornerRadius="6,6,6,6">
                <Grid Name="gridListbox">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>

                    <StackPanel Orientation="Horizontal" 
                            Background="Aquamarine"
                            VerticalAlignment="Top"
                            Margin="2" Grid.Row="0">
                        <TextBox MinHeight="10" 
                             MinWidth="126"
                             Margin="2"
                             Name="searchBox"></TextBox>
                        <Button MinWidth="50"                            
                            Margin="2"
                            Name="searchButton">Find</Button>
                    </StackPanel>
                    <ListBox Name="listBoxItems"    
                         Grid.Row="1" 
                         
                         HorizontalContentAlignment="Stretch"
                         ItemContainerStyle="{DynamicResource ListBoxItem}" 
                         ItemTemplate="{StaticResource listBoxTemplate}" 
                         IsSynchronizedWithCurrentItem="True"
                         ItemsSource="{Binding}"
                         VerticalAlignment="Top"  Height="auto"></ListBox>
                </Grid>
            </Border>
        </Expander>       
        
        <Border Name="borderHeader1" 
                Grid.Column="1" 
                BorderBrush="Gray" 
                BorderThickness="0,1,1,1" 
                CornerRadius="6,6,6,6">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Border Name="borderHeader2" 
                Grid.Row="0"
                BorderBrush="Gray" 
                BorderThickness="0,1,1,1" 
                CornerRadius="6,6,6,6">
                    <my:ucActions x:Name="ucActions"  ></my:ucActions>
                </Border>

                <TabControl Name="TabControlItems" Grid.Row="1" Background="Transparent">
                    <TabItem Header="General" Name="TabItemGeneral">
                        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                            <StackPanel VerticalAlignment="Top">
                                <Grid Name="gridItemGeneral">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="auto"></ColumnDefinition>
                                        <ColumnDefinition></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>                                       
                                        <RowDefinition Height="auto" ></RowDefinition>
                                        <RowDefinition ></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Left">                                        
                                        <Label Margin="5,5,5,0" Foreground="Red" HorizontalAlignment="Left">Description</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxDescription"></TextBox>
                                        <Label Margin="5,5,5,0" Foreground="Red" HorizontalAlignment="Left" >Category</Label>
                                        <!-- ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxCategory" ItemsSource ="{Binding}" IsEditable="True" TextBoxBase.TextChanged="comboBoxCategory_TextChanged" -->
                                        <ComboBox Margin="5,0,5,5" 
                                                  HorizontalAlignment="Left" 
                                                  Grid.Row="8" 
                                                  Width="200" 
                                                  Name="comboboxCategory" 
                                                  ItemsSource ="{Binding}" 
                                                  IsEditable="False">
                                            <ComboBox.Resources>
                                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Silver" />
                                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                            </ComboBox.Resources>
                                        </ComboBox>
                                        <GroupBox Margin="5,5,5,0" Header="Location">
                                            <StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Location</Label>
                                                <!-- ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxLocation" ItemsSource ="{Binding}" IsEditable="True" TextBoxBase.TextChanged="comboboxLocation_TextChanged" -->
                                                <ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxLocation" ItemsSource ="{Binding}" IsEditable="True">
                                                    <ComboBox.Resources>
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Silver" />
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                                    </ComboBox.Resources>
                                                </ComboBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Department</Label>
                                                <!-- ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxDepartment" ItemsSource ="{Binding}" IsEditable="True" TextBoxBase.TextChanged="comboboxDepartment_TextChanged" -->
                                                <ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxDepartment" ItemsSource ="{Binding}" IsEditable="True">
                                                    <ComboBox.Resources>
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Silver" />
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                                    </ComboBox.Resources>
                                                </ComboBox>                                                
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Section</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxSection"></TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Assigned To</Label>
                                                <!-- ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxPerson" ItemsSource ="{Binding}" IsEditable="True" TextBoxBase.TextChanged="comboboxPerson_TextChanged" -->
                                                <ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxPerson" ItemsSource ="{Binding}" IsEditable="False">
                                                    <ComboBox.Resources>
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Silver" />
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                                    </ComboBox.Resources>
                                                </ComboBox>
                                            </StackPanel>                                            
                                        </GroupBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Salvage Value</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxSalvageValue">0.00</TextBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Replacement Cost</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxReplacementCost">0.00</TextBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Condition</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxCondition"></TextBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Status</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxStatus"></TextBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left" >Serial Number</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxSerialNumber"></TextBox>
                                    </StackPanel>
                                    <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Left">
                                        <Label Margin="5,5,5,0" Foreground="Red" HorizontalAlignment="Left">Asset Reference Number</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxAssetNumber"></TextBox>
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left">RFID Number</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxRFIDNumber"></TextBox>
                                        <GroupBox Margin="5,5,5,0" Header="Purchase Information">
                                            <StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Invoice/PO Number</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxInvoiceNumber"></TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Purchased Date</Label>
                                                <StackPanel Orientation="Horizontal">                                                    
                                                    <CheckBox Margin="5,0,5,5" 
                                                              VerticalAlignment="Center"
                                                              Name="cbCalendar"></CheckBox>
                                                    <my1:DatePicker Margin="0,0,5,5"                                                     
                                                                    Name="textboxPurchasedDate" 
                                                                    xmlns:my1="http://schemas.microsoft.com/wpf/2008/toolkit" 
                                                                    IsEnabled="False"
                                                                    ></my1:DatePicker>
                                                </StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Bought From</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxBoughtFrom"></TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Base Cost</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxBaseCost">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">VAT</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxVAT">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Total Cost</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxTotalCost">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Manufacturer</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxManufacturer"></TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Brand</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxBrand"></TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Model Number</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxModelNumber"></TextBox>
                                            </StackPanel>
                                        </GroupBox>
                                    </StackPanel>
                                    <StackPanel Grid.ColumnSpan="2" Grid.Row="1">
                                        <Label Margin="5,5,5,0" HorizontalAlignment="Left">Remarks</Label>
                                        <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="450" Height="100" Name="textboxRemarks"></TextBox>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                        </ScrollViewer>
                    </TabItem>
                    <TabItem Header="Additional" Name="TabItemAdditional">
                        <ScrollViewer>
                            <StackPanel VerticalAlignment="Top">
                                <Grid Name="gridItemAdditional">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="auto"></ColumnDefinition>
                                        <ColumnDefinition Width="auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" Orientation="Vertical"> 
                                        <GroupBox Margin="5,5,5,0" Name="groupBoxLeasedAsset">
                                            <GroupBox.Header>
                                                <CheckBox x:Name="checkboxLeaseAsset">Leased Asset</CheckBox>
                                            </GroupBox.Header>
                                            <StackPanel Orientation="Vertical" IsEnabled="{Binding ElementName=checkboxLeaseAsset, Path=IsChecked}">

                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Lease start</Label>
                                                <StackPanel Orientation="Horizontal">
                                                    <CheckBox Margin="5,0,5,5" 
                                                              VerticalAlignment="Center"
                                                              Name="cbCalendarLeaseStart"></CheckBox>
                                                    <my1:DatePicker Margin="0,0,5,5"                                                     
                                                                    Name="textboxLeaseStart" 
                                                                    xmlns:my1="http://schemas.microsoft.com/wpf/2008/toolkit" 
                                                                    IsEnabled="False"
                                                                    ></my1:DatePicker>
                                                </StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Lease end</Label>
                                                <StackPanel Orientation="Horizontal">
                                                    <CheckBox Margin="5,0,5,5" 
                                                              VerticalAlignment="Center"
                                                              Name="cbCalendarLeaseEnd"></CheckBox>
                                                    <my1:DatePicker Margin="0,0,5,5"                                                     
                                                                    Name="textboxLeaseEnd" 
                                                                    xmlns:my1="http://schemas.microsoft.com/wpf/2008/toolkit" 
                                                                    IsEnabled="False"
                                                                    ></my1:DatePicker>
                                                </StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Details</Label>
                                                <TextBox Margin="5,5,5,0" Width="250" Height="100" Name="textboxLeaseDetails"></TextBox>
                                            </StackPanel>                                            
                                        </GroupBox>
                                        <GroupBox Margin="5,5,5,0" Name="groupBoxWarranty" >
                                            <GroupBox.Header>
                                                <CheckBox x:Name="checkboxWarranty" >Warranty</CheckBox>
                                            </GroupBox.Header>
                                            <StackPanel Orientation="Vertical" IsEnabled="{Binding ElementName=checkboxWarranty, Path=IsChecked}">
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Warranty end</Label>
                                                <StackPanel Orientation="Horizontal">
                                                    <CheckBox Margin="5,0,5,5" 
                                                              VerticalAlignment="Center"
                                                              Name="cbCalendarWarrantyEnd"></CheckBox>
                                                    <my1:DatePicker Margin="0,0,5,5"                                                     
                                                                    Name="textboxWarrantyEnd" 
                                                                    xmlns:my1="http://schemas.microsoft.com/wpf/2008/toolkit" 
                                                                    IsEnabled="False"
                                                                    ></my1:DatePicker>
                                                </StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Details</Label>
                                                <TextBox Margin="5,5,5,0" Width="250" Height="100" Name="textboxWarrantyDetails"></TextBox>
                                            </StackPanel>
                                        </GroupBox>
                                    </StackPanel>
                                    <StackPanel Grid.Column="1">
                                        <GroupBox Margin="5,5,5,0" Name="groupBoxDispose">
                                            <GroupBox.Header>
                                                <CheckBox x:Name="checkBoxDisposedAsset">Dispose</CheckBox>
                                            </GroupBox.Header>
                                            <StackPanel Orientation="Vertical" IsEnabled="{Binding ElementName=checkBoxDisposedAsset, Path=IsChecked}">
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Disposal type</Label>
                                                <ComboBox Margin="5,0,5,5" HorizontalAlignment="Left" Grid.Row="8" Width="200" Name="comboboxDisposalType" ItemsSource ="{Binding}" IsEditable="True">
                                                    <ComboBox.Resources>
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Silver" />
                                                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                                    </ComboBox.Resources>
                                                </ComboBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Date disposed</Label>
                                                <StackPanel Orientation="Horizontal">
                                                    <CheckBox Margin="5,0,5,5" 
                                                              VerticalAlignment="Center"
                                                              Name="cbCalendarDateDisposed"></CheckBox>
                                                    <my1:DatePicker Margin="0,0,5,5"                                                     
                                                                    Name="textboxDateDisposed" 
                                                                    xmlns:my1="http://schemas.microsoft.com/wpf/2008/toolkit" 
                                                                    IsEnabled="False"
                                                                    ></my1:DatePicker>
                                                </StackPanel>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Amount sold</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxAmountSold">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Profit</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxProfit">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Gain/Loss</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxGainLoss">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">Accumulated depreciation</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxAccumulatedDepreciation">0.00</TextBox>
                                                <Label Margin="5,5,5,0" HorizontalAlignment="Left">BV</Label>
                                                <TextBox Margin="5,0,5,5" HorizontalAlignment="Left" Width="200" Name="textboxBV">0.00</TextBox>
                                            </StackPanel>
                                        </GroupBox>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                        </ScrollViewer>
                    </TabItem>
                    <TabItem Header="Images" Name="TabItemImages" >
                        <ScrollViewer>
                            <StackPanel VerticalAlignment="Top">
                                <Grid Name="gridItemImages">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"></RowDefinition>
                                        <RowDefinition></RowDefinition>                                        
                                    </Grid.RowDefinitions>
                                    <StackPanel HorizontalAlignment="left" Orientation="Horizontal" Grid.Row="0">
                                        <Button Name="btnAddImage" Margin="5"  Width="100">Add Image</Button>                                        
                                    </StackPanel  >
                                    <Grid Grid.Row="1">
                                        <ListBox Grid.Row="3"
                                                 Name="ListBoxItemImages"
                                                 ItemsSource="{Binding}"
                                                 ItemTemplate="{StaticResource listBoxImageTemplate}"  >
                                            <ListBox.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <WrapPanel IsItemsHost="True"
                                                               Width="{Binding ActualWidth,
                                                        RelativeSource={RelativeSource Mode=FindAncestor, 
                                                        AncestorType={x:Type ScrollContentPresenter}}}" />
                                                </ItemsPanelTemplate>
                                            </ListBox.ItemsPanel>
                                        </ListBox>
                                        
                                    </Grid>
                                    
                                </Grid>
                            </StackPanel>
                        </ScrollViewer>
                    </TabItem>
                </TabControl>                
            </Grid>
        </Border>
    </Grid>

</UserControl>


    
          
